package com.huluobo.a2210mdmdemo.demo

import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.modifier.modifierLocalMapOf
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp

/**
 *  Created by LC on 2025/3/24.
 */

@Composable
fun Demo02() {
    Box(modifier = Modifier.padding(10.dp), contentAlignment = Alignment.TopEnd) {
        Text(
            text = "hello", modifier = Modifier
                .background(Color.Yellow, RoundedCornerShape(10.dp))
                .border(
                    1.dp, Color.Blue,
                    RoundedCornerShape(10.dp)
                )
                .padding(vertical = 5.dp, horizontal = 10.dp)
        )
        Text(
            text = "1",
            color = Color.White,
            textAlign = TextAlign.Center,
            fontSize = 8.sp,
            modifier = Modifier
                .size(16.dp)
                .offset(3.dp, (-5).dp)
                .background(Color.Red, CircleShape)
                .padding(3.dp)
        )

    }
}